fold

inline fun <R> fold(successTransform: (T) -> R, failureTransform: (Throwable) -> R): R

Transforms a Success using successTransform or a Failure using failureTransform.

Return

Result of applying successTransform on Success or failureTransform on Failure.

Parameters

successTransform

Function transforming value of a Success to a new Try.

failureTransform

Function transforming exception from a Failure to a new Try.